import React from 'react';
import {
    Button,
    Text,
    View,
    Image,
    StyleSheet,
    Dimensions,
    StatusBar,
    ActivityIndicator,
    FlatList,
    ScrollView,
    RefreshControl,
    Animated,
    TouchableHighlight,
    SectionList,
    TouchableOpacity,
    Modal, DeviceEventEmitter
} from 'react-native';
import Swiper from 'react-native-swiper';
import { createBottomTabNavigator } from 'react-navigation-tabs';
import AsyncStorage from '@react-native-community/async-storage';
const { width, height } = Dimensions.get('window');
import Styles from './Styles';

import app from '../../../app.json';
import Ugame from '../../../Ugame';
import Httpc from "../../utils/Httpc";
import REQUEST from "../../../REQUEST";
import Football from "../../utils/Football";
import Utils from "../../utils/Utils";

export default class Guanzhu extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            page: 0,
            rows: 10,
            total: 0,
            totalpage: 1,
            lists: [],
            loaded: true,
            refreshing: false,

        };

    }
    static navigationOptions = {
        title: '我的关注',
        //header: null,  //隐藏顶部导航栏
        //tabBarVisible: false, // 隐藏底部导航栏
        headerStyle: {
            backgroundColor: '#d0162e',
        },
        headerTintColor: '#fff',
        headerTitleStyle: {
            marginTop: 18
        },
    }

    componentDidMount() {
        if(Ugame.isLogin){
            this.getServerData(function(){});
        }

    }
    getServerData(callback) {
        let _this = this;
        let params = {};
        let { type, days, page, rows, lists } = this.state;
        if (page == 1) {
            lists = [];
        }
        params.token = Ugame.info.token;
        params.page = page + 1;
        params.rows = rows;
        Httpc.get(REQUEST.GetMyFollowFans, params, function (res) { 
            if (res.StatusCode == 1) {
                if (res.Data.length > 0) {
                    _this.setState({
                        page: page + 1,
                        total: res.total,
                        totalpage: res.totalpage,
                        lists: lists.concat(res.Data),
                    });
                    callback();
                }
            }
        })
    }

    render() {

        return (
            <View style={Styles.container}>
                <StatusBar translucent={true} backgroundColor="transparent" />
 
     


            </View>
        )
    }
}

